<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>
<%@taglib uri="/struts-tags" prefix="s"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<html>
<head>
<title>网络新闻应急性管理系统</title>

<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="this is my page">
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<link rel="stylesheet" type="text/css" href="/res/style/common.css">
<link rel="stylesheet" type="text/css" href="/res/style/admin.css">
<link rel="stylesheet" type="text/css" href="/res/style/newsManage.css">
<script type="text/javascript" src="/res/script/common.js"></script>
<script type="text/javascript" src="/res/script/menu.js"></script>
<script type="text/javascript" src="/res/script/newsManage.js"></script>
<script type="text/javascript" src="/res/library/js/flyfox_js_view.js"></script>
</head>

<body onload="addMenu();">
	<div class="MainDiv">
		<div class="AjustDiv">
			<jsp:include page="/page/admin/adminHeader.jsp"></jsp:include>
			<jsp:include page="/page/admin/adminLeft.html"></jsp:include>
			<!-- 内容部分 -->
			<div class="ContentDiv">
				<div style="margin-top:20px;"></div>
				<div class="ChangePageDiv" id="id_ChangePageDiv">
					<table>
						<tr>
							<td>
								<input type="number" value="${pageParam.index}" id="id_PageIndex" hidden="true"/>
								<label>显示条数：</label>
								<input type="number" style="width:45px;text-align:center" value="${pageParam.size}" id="id_PageSize" onchange="showPage('${pageParam.action}')"/>
							</td>
							<td><label>紧急度：</label>
								<select id="id_Degree" onchange="showPage('${pageParam.action}')">
									<option value="0">全部</option>
									<option value="1">一般</option>
									<option value="2">较紧急</option>
									<option value="3">紧急</option>
									<option value="4">很紧急</option>
									<option value="5">超紧急</option>
								</select>
								<label>类型：</label>
								<select id="id_Type1" onchange="showPage('${pageParam.action}')">
									<option value="0">全部</option>
									<c:forEach items="${newsTypes}"  var="t" varStatus="tStatus">
										<c:if test="${t.type == 1}">
											<option value="${t.id}">${t.content}</option>
										</c:if>
									</c:forEach>
								</select>
								<select id="id_Type2" onchange="showPage('${pageParam.action}')">
									<option value="0">全部</option>
									<c:forEach items="${newsTypes}"  var="t" varStatus="tStatus">
										<c:if test="${t.type == 2}">
											<option value="${t.id}">${t.content}</option>
										</c:if>
									</c:forEach>
								</select>
								<select id="id_Type3" onchange="showPage('${pageParam.action}')">
									<option value="0">全部</option>
									<c:forEach items="${newsTypes}"  var="t" varStatus="tStatus">
										<c:if test="${t.type == 3}">
											<option value="${t.id}">${t.content}</option>
										</c:if>
									</c:forEach>
								</select>
							</td>
							<td>
								<input type="date" id="id_PublishTime" onchange="showPage('${pageParam.action}')" value="2013-03-12">
							</td>
							<td>
								<input type="date" id="id_ActiveTime" onchange="showPage('${pageParam.action}')" value="2013-03-12">
							</td>
							<td>
								<button onclick="add()">添加</button>
							</td>
					
						</tr>
					</table>
					
				</div>
				<script type="text/javascript">
					var pageBar = new PageBar('${pageParam.index}','${pageParam.size}','${pageParam.totalCount}','${pageParam.action}' + '?s=' + '${pageParam.size}');
					
					var div = document.getElementById('id_ChangePageDiv');
					div.appendChild(pageBar.bar);
				</script>

				<c:forEach items="${newsList}" var="n" varStatus="nStatus">
					<div class="NewsItem">
						<div>
							<label>${nStatus.index + 1}</label>
						</div>
						<div class="NewsTitle">
							<a href="">${n.mainTitle}</a>
						</div>
						<label>发布时间：${n.releaseTime }</label> 
						<label>关注：${n.concernCount}</label> <label>评论 ：${n.commentCount }</label>
						<div class="ButtonDiv">
							<button name="${n.id }" onclick="deleteNews(this)">删除</button>
							<button name="${n.id }" onclick="edit(this)">编辑</button>
							<button name="${n.id }" onclick="open(this)">推送</button>
						</div>
					</div>
				</c:forEach>
				
				<div style="margin-bottom:40px;"></div>
			</div>
		</div>
	</div>
	<jsp:include page="/page/admin/adminFooter.html"></jsp:include>
</body>
</html>
